/*
 * AutoCompleteRecord.java
 *
 * Copyright(c) 2010
 * Michael Kroez
 * kroez@studiorutton.de
 *
 * All rights reserved.
 *
 * $Id$
 * 
 */

package de.studiorutton.gerengdic.databaseaccess.records;

import java.util.ArrayList;

public class IndexRecord {
	public final static byte INDEX_RECORD_HEADER = 0x05;
	private String key;
	private ArrayList<Integer> recordPositions;
	
	public IndexRecord( String key, ArrayList<Integer> recordPositions) {
		this.key = key;
		this.recordPositions = recordPositions;
	}
	
	public String getKey() {
		return key;
	}
	
	public ArrayList<Integer> getRecordPositions() {
		return recordPositions;
	}
	
	public void setRecordPositions( ArrayList<Integer> positions ) {
		this.recordPositions = positions;
	}
	
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append( "AutoCompleteRecord: key = " );
		sb.append( key );
		if ( recordPositions != null ) {
			sb.append( " RecordPositions: ");
			sb.append( recordPositions.size());
		}
		
		return sb.toString();
	}
}
